const authLoginRoutes = [
  '/writecenter',
  '/setting',
  '/notification',
  '/browsehistory',
  '/resume'
]

export default function ({ store, redirect, route }) {
  const userInfo = store.state.userInfo
  if (!userInfo) {
    for (let i = 0; i < authLoginRoutes.length; i++) {
      if (route.path.includes(authLoginRoutes[i])) {
        redirect('/')
        break
      }
    }
  }
}
